from selenium.webdriver.common.by import By
from base.base_page import BasePage

class LoginPage(BasePage):
    def __init__(self):
        super().__init__()
        self.user = (By.ID,"username")
        self.pwd = (By.XPATH,"//*[@type='password']")
        self.code = (By.CSS_SELECTOR,"[name='verify_code']")
        self.login_button = (By.CSS_SELECTOR,"[name='sbtbutton']")

    def login(self,user,pwd,code):
        self.input_text(self.find_el(self.user),user)
        self.input_text(self.find_el(self.pwd),pwd)
        self.input_text(self.find_el(self.code), code)
        self.find_el(self.login_button).click()

if __name__ == '__mian__':
    print(LoginPage().user)
    print(*LoginPage().user)
